package 行为型设计模式.观察者模式.demo;

/**
 * 创建具体的时间观察者
 * @Author lf
 * @Date 3/17/2024
 */
public class MessageListener implements EventListener{

    private String name;

    public MessageListener(String name) {
        this.name = name;
    }

    @Override
    public void update(MessageEvent event) {
        System.out.println(name + " received message: " + event.getMessage());
    }
}
